﻿using System;

namespace ContactCenter.Core.DomainModel
{
    /// <summary>
    /// Value object for customer's address.
    /// </summary>
    [Serializable]
    public class AddressInfo : ValueObject<AddressInfo>
    {
        protected AddressInfo()
        {
        }

        public AddressInfo(string address, string postalCode, string city, string region)
        {
            Address = address;
            PostalCode = postalCode;
            City = city;
            Region = region;
            
            RegisterProperty(val => val.Address);
            RegisterProperty(val => val.PostalCode);
            RegisterProperty(val => val.City);
            RegisterProperty(val => val.Region);
        }

        public string Address { get; private set; }
        public string PostalCode { get; private set; }
        public string City { get; private set; }
        public string Region { get; private set; }

        public override string ToString()
        {
            return string.Format("{0} {1} {2} ({3})", Address, PostalCode, City, Region);
        }
    }
}
